<?php
global $_W, $_GPC;
$openid = m("user")->getOpenid(true);
if (allow_commission() == false) {
    header("Location:" . create_url('mobile', array('act' => 'shopwap', 'do' => 'membercenter')));
    exit;
}


$set = globalSetting('commission');
if (empty($set['level'])) {
    header("Location:" . create_url('mobile', array('do' => 'shop', 'act' => 'index', 'm' => 'eshop')));
    exit;
}
$member = m('commission')->getInfo($openid, array(
    "total",
    "ordercount0",
    "ok"
));
add_udid();
$where = 'fx_id='.$member['id'];
$sql = 'select * from ' . tablename('eshop_member_udid').' where '.$where;
$udid_list = pdo_fetchall($sql);
foreach((array)$udid_list as $k=>$v){
	if($v['user_id']){
		$m = pdo_fetch('select * from ' . tablename('eshop_member') . ' where id='.$v['user_id']);
		$udid_list[$k]['nickname'] = $m['nickname']?$m['nickname']:'';
		$udid_list[$k]['phone'] = $m['mobile']?$m['mobile']:'';
	}else{
		$udid_list[$k]['nickname'] = '';
	}
	get_agent_number($v['user_id']);
	if($v['status']==1){
		$number = count($_SESSION['agentnumber'])+1;
	}else{
		$number = 0;
	}
	$udid_list[$k]['number'] = $number;
	unset($_SESSION['agentnumber']);
}
include $this->template("myid");
?> 